package chixing.day11.class1;

public class DataTransfer {
    public static void main(String[] args) {
    int a=1;
    int b=2;
    fun1(a,b);
        System.out.println("a="+a);
        System.out.println("b="+b);

    Book book=new Book("数据结构",99.9f);
    fun2(book);
        System.out.println(book.getBookName());
        System.out.println(book.getBookPrice());

    }
    //int x =a 基本数据类型的赋值 是将值复制一份给其他变量
   public static void fun1(int a,int b){
       a=10;
       b=20;
    }
    //引用数据类型的赋值 传递的是堆内存地址（指向同一块内存）地址传递
    //Book xx=book;
    public static void fun2(Book book){
        book.setBookName("java程序设计");
        book.setBookPrice(89.9f);
    }


}
